package com.cloud.controller;

import com.cloud.pojo.Category;
import com.cloud.result.BaseResult;
import com.cloud.service.CategoryService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 广告
 */
@RestController
@RequestMapping("/user/category")
public class CategoryController {
  @DubboReference
  private CategoryService categoryService;
  /**
   * 查询全部启用广告
   *
   * @return 查询结果
   */
  @GetMapping("/all")
  public BaseResult<List<Category>> findAll() {
    List<Category> categories = categoryService.findAll();
    return BaseResult.ok(categories);
   }
}
